package cn.anquing.demo.mybatisplus.code.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 
 * </p>
 *
 * @author wqq
 * @since 2022-04-27
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("user")
@ApiModel(value="User对象", description="")
public class User extends Model<User> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    //@Excel(name = "主键", width = 15)
    @TableId("id")
    private Long id;

    @ApiModelProperty(value = "姓名")
    //@Excel(name = "姓名", width = 15)
    // condition = SqlCondition.LIKE
    @TableField(value = "name")
    private String name;

    @ApiModelProperty(value = "年龄")
    //@Excel(name = "年龄", width = 15)
    @TableField(value = "age",condition = "%s&gt;#{%s}")
    private Integer age;

    @ApiModelProperty(value = "邮箱")
    //@Excel(name = "邮箱", width = 15)
    @TableField("email")
    private String email;

    @ApiModelProperty(value = "直属上级id")
    //@Excel(name = "直属上级id", width = 15)
    @TableField("manager_id")
    private Long managerId;

    @ApiModelProperty(value = "创建时间")
    //@Excel(name = "创建时间", width = 15)
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
